The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
Pagination in SalesLogix
Posted: 31 Aug 07 1:01 AM
|
I have a requirement to delete an opportunity if user changes some inputs in opportunity screen. It basically deletes the opportunity id from opportunity table. Problem is, the pagination does not get refreshed. it says "Invalid record" if i traverse to the deleted record.
I have tried Application.MainViews.ActiveView.Refresh but a window pops up which i dont want. Can anyone please help as to how to refresh the pagination after deletion of record which occurs automatically. |
|
|
|
Re: Pagination in SalesLogix
Posted: 31 Aug 07 2:10 AM
|
So you are deleting the current record. Which record do you want to display after performing the deletion?
Have you thought about using Application.BasicFunctions.DoInvoke "Edit:DeleteItem"
(something like that anyway) and letting SLX handle the deletion? |
|
|
|
Re: Pagination in SalesLogix
Posted: 02 Sep 07 5:29 PM
|
You need to use Cascadedelete to make sure ALL the child records get deleted. It's in the LAN dev ref.
Application.BasicFunctions.CascadeDelete
-- rjl |
|
|
|
Re: Pagination in SalesLogix
Posted: 04 Sep 07 2:53 AM
|
Hi,
If I use cascade delete from account table, after deleting the record, I am getting "Invalid record". If I try to refresh the main view after deleting, I am getting a prompt from saleslogix also it says "you dont have access to this account" and then the record gets deleted and then the screen goes blank. it is not even refreshing the account main view... any ideas as to how to delete an account programmatically without using the Application.BasicFunctions.DoInvoke "Edit:DeleteItem".
I want the delete to happen just like how saleslogix delete account performs. I am unable to find the code for account delete since it is SLX function. |
|
|
|
Re: Pagination in SalesLogix
Posted: 05 Sep 07 6:25 AM
|
When you use Application.Basicfunction.CascadeDelete you provide the contact/account/whatever PKID and it deleted the parent as well as the children.
-- rjl |
|
|
|
Re: Pagination in SalesLogix
Posted: 05 Sep 07 7:40 AM
|
Since the current record you are viewing was deleted you will need to figure out what record/group you want to move to after the current record is deleted. Actually, you may want to get the target record ID of the record to delete, figure out what record you want to move to, move to it, then delete the target record.
The Cascade delete function deletes the record and all childern (based on the informaiton in the SLX MetaData) you need to do the rest. |
|
|
|
Re: Pagination in SalesLogix
Posted: 05 Sep 07 8:47 AM
|
I ran into the same problem and was looking for an .ActiveView.MoveNext function but came up empty. I ended up writing code using SendKeys to move to the next record in the lookup and then went back and deleted (or in my case, changed the ownership of) the record. I would have rather not used SendKeys, but I couldn't find anyother way. I'm using SLX 6.2.6
I posted my "MoveToNextRecord" code here: http://www.slxdeveloper.com/forum.aspx?forumid=2000&postid=10325#10325
Note: The "MoveToNextRecord" Code referenced above assumes that you have already created a SendKeys subroutine. If you do not have one here is some code you can use below. I'm sure it came from somewhere on this forum.
------- Sub SendKeys(ByVal strApplicationName, ByVal strKeys)
Dim objWSShell
Set objWSShell = CreateObject("WScript.Shell")
With objWSShell If Len(strApplicationName) > 0 Then .AppActivate strApplicationName .SendKeys strKeys End With
Set objWSShell = Nothing
End Sub ------- |
|
|
|