It's me again with more Dexterity questions.
I thought I was following the examples in the manuals (and sample integration) fairly well, but I just can't seem to get these to work.
I'll start with the RW functions. I decided I didn't really want to make an alternate report as I didn't need to make that many changes to it. So I decided the best way was to create a function to add the data I want via Calculated fields.
For reference sake I'm adding a field that will show if an item is on an order with a particular hold applied (Inventory Purchase Advice By Vendor report). Once I can get the calculated field working properly, I can add the specifics - which won't be a problem. The problem is getting it working, I'm receiving the error: "User defined function failed in execution." Now here are the details on the function.
Startup (Core: System)
GetAdditionalIVData (Core: System)
As you can see very simple - meant to just return the value given to it, as a test to make sure it works and from there I would modify it.
Here is the calculated field definition:
It should (as far as I can see) just duplicate the Item number (according to the script), but it just produces the above error.
The other problem is with adding a GoTo to an existing SmartList. The Sales groups (Sales Transactions, and Sales Line Items) now intelligently decide which form to open SOP_Entry or SOP_Inquiry. I'm hoping to restore the choice a user has if the document is password protected for editing, thus allowing them to still view the document via SOP_Inquiry quickly and easily.
I got the menu item to show up - but clicking on it does absolutely nothing. Here are the scripts:
Startup (Core: System)
SmartList_AddSalesInquiry (Core: System)
Explorer_GoTo_Button (Core: System)
I can't seem to see where these 2 things are going wrong - any ideas?
Thanks.
I thought I was following the examples in the manuals (and sample integration) fairly well, but I just can't seem to get these to work.
I'll start with the RW functions. I decided I didn't really want to make an alternate report as I didn't need to make that many changes to it. So I decided the best way was to create a function to add the data I want via Calculated fields.
For reference sake I'm adding a field that will show if an item is on an order with a particular hold applied (Inventory Purchase Advice By Vendor report). Once I can get the calculated field working properly, I can add the specifics - which won't be a problem. The problem is getting it working, I'm receiving the error: "User defined function failed in execution." Now here are the details on the function.
Startup (Core: System)
Code:
if Trigger_RegisterFunction(function rw_TableLineString, TRIGGER_AFTER_ORIGINAL, function GetAdditionalIVData) <> SY_NOERR then
warning "Report function trigger registration failed.";
end if;
Code:
function returns string sData;
in integer dict_id;
in string report_name;
in string sNumber;
in integer sType;
in currency cSequenceOne;
in currency cSequenceTwo;
in integer iControl;
{If this function is not for our product then quit}
{
if dict_id <> Runtime_GetCurrentProductID() then
abort script;
end if;
}
sData = sNumber;
As you can see very simple - meant to just return the value given to it, as a test to make sure it works and from there I would modify it.
Here is the calculated field definition:
Code:
FUNCTION_SCRIPT( rw_TableLineString 0 "Inventory Purchase Advice Report By Vendor" IV_Purchase_Advice_Vendor_TEMP.Item Number 0 0 0 0 )
The other problem is with adding a GoTo to an existing SmartList. The Sales groups (Sales Transactions, and Sales Line Items) now intelligently decide which form to open SOP_Entry or SOP_Inquiry. I'm hoping to restore the choice a user has if the document is password protected for editing, thus allowing them to still view the document via SOP_Inquiry quickly and easily.
I got the menu item to show up - but clicking on it does absolutely nothing. Here are the scripts:
Startup (Core: System)
Code:
if Trigger_RegisterFocusByName(SMARTLIST, "form ASI_Explorer", TRIGGER_FOCUS_PRE, TRIGGER_AFTER_ORIGINAL, script SmartList_AddSalesInquiry) <> SY_NOERR then
warning "Focus trigger registration for SmartList failed.";
end if;
SmartList_AddSalesInquiry (Core: System)
Code:
local integer l_error;
local string l_message;
local integer prod_id;
prod_id = Runtime_GetCurrentProductID();
{
SMARTLIST_OBJECTTYPE_SALESTRANSACTIONS or IN_Object_Type = SMARTLIST_OBJECTTYPE_SALESLINEITEMS
}
call with name "Explorer_Add_GoTo_Item" in dictionary SMARTLIST,
DYNAMICS,
SMARTLIST_OBJECTTYPE_SALESTRANSACTIONS,
"Document Inquiry -bor",
prod_id,
resourceid(form PDP_BOR_Docs), {Unique ID for this form}
false, {Not the default Go To item}
l_error;
if l_error <> OKAY and l_error <> DUPLICATE then
{set l_message to getmsg(22002);
substitute l_message, "Explorer_Add_GoTo_Item", str(l_error);
error l_message;}
error "SmartList items not added.";
end if;
call with name "Explorer_Add_GoTo_Item" in dictionary SMARTLIST,
DYNAMICS,
SMARTLIST_OBJECTTYPE_SALESLINEITEMS,
"Document Inquiry",
prod_id,
resourceid(form SOP_Inquiry), {Unique ID for this form}
false, {Not the default Go To item}
l_error;
if l_error <> OKAY and l_error <> DUPLICATE then
{set l_message to getmsg(22002);
substitute l_message, "Explorer_Add_GoTo_Item", str(l_error);
error l_message;}
error "SmartList items not added.";
end if;
Explorer_GoTo_Button (Core: System)
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;
warning "GoTo chosen";
{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
warning "ST_Doc Inquiry or STL_Doc Inquiry";
end if;
end if;
end if;
end if;
I can't seem to see where these 2 things are going wrong - any ideas?
Thanks.