Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dex SmartList GoTo button 1

Status
Not open for further replies.

Borvik

Programmer
Jan 2, 2002
1,392
US
I've gotten stuck on the GoTo button.

Using the example from the sample integrating application I've constructed the code for Explorer_GoTo_Button:
Code:
inout anonymous field IN_ListView;
in integer IN_Object_Dict_ID;
in integer IN_Object_Type;
in integer IN_GoTo_Dict_ID;
in integer IN_GoTo_Item;

local long selected_item;
local string LeadID;
local string CustomerID;
local integer l_current_status;

{Is this the Go To item added to the Customer object?}
if IN_Object_Dict_ID = DYNAMICS then
	if IN_Object_Type = SMARTLIST_OBJECTTYPE_SALESTRANSACTIONS or IN_Object_Type = SMARTLIST_OBJECTTYPE_SALESLINEITEMS then
		if IN_GoTo_Item = resourceid(form SOP_Inquiry) then
			{Try to find the first customer selected in the list}
			selected_item = ListView_SelectionGet(IN_ListView, 1);
			if selected_item <> 0 then
				CustomerID = ListView_ItemGetLabel(IN_ListView, selected_item);
				warning CustomerID;
			end if;
		end if;
	end if;
end if;
I used this to determine to see how the selection was going.

This is what I found out. When under "Sales Transactions" I get something similar to:
ORDST2227 2STDORD BERRYMED0001

When under "Sales Line Items" I get something similar to:
2ORDST2226
00000000000000000000000000000000000000000000049152

Obviously these are strings as CustomerID (to be renamed appropriately later) is of type string.

I need the SOP Type and SOP Number in both instances. While I can see them and could probably parse the string for them - that is not the optimal solution as I cannot guarantee that the SOP Number will follow the same scheme.

What is the best way to retrieve both the SOP Type and SOP Number during the Explorer_GoTo_Button script?

Thanks in advance!
 
There is also the ListView_ItemGetData() command that might contain useful data.

I think you will need to parse the data you already have. The 2 is the SOP Type. You know what the maximum length of the SOP Number is so you can grab that and then trim() off the spaces.

David Musgrave [MSFT]
Senior Development Consultant
Escalation Engineer - Great Plains
Microsoft Dynamics Support - Asia Pacific

Microsoft Dynamics (formerly Microsoft Business Solutions)

Any views contained within are my personal views and
not necessarily Microsoft Business Solutions policy.
This posting is provided "AS IS" with no warranties,
and confers no rights.
 
I did know what the 2 was, but I forgot that all strings are of fixed length - that solves the unknown sop number format.

Looks like that is the way to go.

Thanks Dave.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top