Run. Run far away from this.
There are soooo many issues.
First of all–if you’re using the slide out panel, it doesn’t actually send the contextValues. Neat. If you’re going that route, they’re gonna have to select the proper contact themselves, but at least it gets them to the correct customer.
Second–I had it open in a new tab which has its own problems. For one, it doesn’t actually take you to the ContactDetail page. It does, however, pass the contextValue. Woohoo! Sort of. Turns out the PrcConNum in OrderHed is not what you need, so before you call the app-open widget, you’ll need to do a rest call to the Erp. BO.CustCntSvc and GetByID to get the PerConID. (Assuming you’re calling from Order Entry. You never really specified, so that’s where I ended up, but I assume the problem would be the same across the board).
Okay, so now I’m passing the proper ID through the context, but I was getting a CustCnt not found error. But why? So, I moved it to a button click instead of OnLoad, so I can view it in Dev Tools. When I click the button, it sets Contact.PerConID to the contextValue. I look at the network call and it’s passing the correct value, but it’s still throwing an error.
I typed it in manually and compared the call and it’s sending a dataset with when you type it in manually. FFS. So now you have to set that too. Oh–an then you have to use the page-navigate-to widget to make it go to the proper page. Good lord.
**IMPORTANT EDIT: Make sure you create a new layer for Customer Entry that is NOT the layer you use if you go there from the menu. The reason being is because some of the data you’re sending it from the Launch Options makes it work. Without that, it will crash on load. So, if you have a customized version of Customer Entry, make a copy of that to be the version you call in your Launch Options.
Any who… enough ranting, here’s the details:
Pushy dah button.
Button click details. Rest > App-Open
Rest Config:
Create your View that you named above.
App-Open Config
Launch Options:
{
"options": {
"valueIn": "{OrderHed.CustomerCustID}",
"contextValue": {
"Param1": "{CustCnt.PerConID}"
}
}
}
ON THE CUSTOMER ENTRY SIDE
On Load Event
Set the current data view to Contact:
Use Row-Update to set the Contact.PerConID to the contextValue:
Finally, navigate to the contact page.
Once you’ve done all that… go pour a whiskey because DAMN that was annoying. * Shakes fist at App-Studio *