Formatted Search and Item Events
Hi,
I am having a huge problem with using Formatted Search and Add-Ons.
On the Sales Order Form I have a Formatted search Setup on the Customer Reference Number, it is set to Auto-Refresh when the CardCode changes. This is the only Formatted search on this form and it works fine.
However, when I run my Add-On, and enter an Item Code it takes about 30 seconds to display the Item Description. In tracing my Add-On it appears to call the Item Event et_GOT_FOCUS on the Item Code Column I just entered over 50 times. I don't use other events, but for testing I did turn on all events and the only other event it occured with was et_LOST_FOCUS.
If I turn off my Add-On or turn off Auto Refresh on the Formatted search everything runs as it should.
I figure the Auto Refresh of the Formatted search has something to do with this, but I need to have this turned on. Another thing is that it only seems to call this event when Before Action = false, It does not seem to be called on Before Action = True.
Can I disable the Formatted search temporarily from within my add-on or is there something else I need to do to keep this from happening.
Thanks for Any Help
Paul
Hi Alfredo,
Thanks for the suggestion, that sounds like it might be what I am looking for. But I am confused on trying to visualize how this would work. Do I need to duplicate the entire logic that Business One already does or are there some functions in the DI/UI that I can call that does the functions. Since I am doing this from a System(Sales Order) not User Defined Form, does that change anything. I did see the FormattedSearches Object to add a Formatted Search through the DI, but that seems like it will just create the Object and not help me execute it from my Add On.
Is there some code snipits you could provide or get me going in the right direction on how to implement the formatted searches from within my Add-On.
Thanks Again,
Paul
Similar Messages
-
Content Search and 'Items Matching a Tag' Web Part Not Displaying Results Shown in Preview
Hi
I've been trying to set up both the Content Search and Items Matching a Tag Web Parts with the same issue. In both cases I can create a query which displays the expected results in the Search Result Preview pane but no results are returned when browsing
the page.
I'm a Site Collection administrator
tried viewing the page in IE8, Chrome and Firefox
another user account with Full Control permissions on the site results in the same issue
I've reindexed the site (which has completed as other alterations on the content are now being returned in the normal search results)
I've tried removing and re-adding the offending web parts
The queries in both web parts are pushed back to the most simple possible - ie all documents in the current site collection for the Content Search query and 'Current site collection + Don't restrict by any tag' in the Items Matching a Tag
I haven't touched the display templates or made any other alterations AT ALL - this is a virgin site collection beyond documents in a library
Does anyone have any ideas?I was able to make this do what I needed it to.
-
Issue with Formatted Search and Sales BOM
Good afternoon,
One of our customers uses a Formatted Search on the Sales Order row to lookup the Project Code stored against the Item.
This works very well, except for when a Sales BOM is selected. I assume the FS lookup is working correctly, but the screen is quickly refreshed to list all the component items related to the BOM. This process appears to overwrite the contents of the Project field.
We wish to keep this functionality, but retain the FS lookup results in the Project column. Could the order of the process be changed so that the BOM refresh occurs prior to the FS lookup.
Thanks
Greig
Edited by: Greig Burrows on Jul 21, 2010 5:57 PMHi,
For metadata, which metadata are you not seeing? Are they custom properties within the PDF, and have you checked if you have crawled properties matching these?
I know there's issue with last modified on PDF's (http://sharepointfieldnotes.blogspot.no/2013/05/understanding-and-getting-sharepoint.html)
Thanks,
Mikael Svenson
Search Enthusiast - SharePoint MVP/MCT/MCPD - If you find an answer useful, please up-vote it.
http://techmikael.blogspot.com/
Author of Working with FAST Search Server 2010 for SharePoint -
Creating a Formatted Search in Item Master based on Unit Price
Hi Experts,
I have to create a Formatted Search for assigning the Standard Cost of Items as Selling Price-Selling Price*.05 i.e the Standard cost of the item should be set upon automatically equal to 5% less of Selling Price .
I have created the following Formatted Search Query :
SELECT ((SELECT $[$34.68.NUMBER])-(SELECT $[$34.68.NUMBER] *.05))
and have assigned this FS to Standard Cost Field . I am not able to base it upon Unit Price field . This FS is correct but it is not automatically refreshing upon change of Unit Price and I have to manually update it(ALT+F2) . I guess the filed upon which it should be based upon is not correct .
please guide me how to resolve this issue . How to base this FS upon Unit Price.
Thanks and Regards,
Pooja Singh.Hi,
Actually I dont want to set upon the last No for the Series. What about the Sequence ? Administration->setup->financials->Tax->Sequence. Here also the same thing can be done but Location Specific. When I created 2 Series for the two different locations , I found that two different fields appeared on the screen Sequence Name Where I found the two sequences I defined for the two locations. If you have any idea about what this sequence is for and how far is it different from Document Series , please let me know.
Thanks and Regards,
Pooja Singh -
Formatted Search on Item Master
Experts,
I have a client who sells commodities. They need their Pricelists to be updated with each Purchase, because of fluctuating Prices.
If I can get the following Formatted Search to work, I believe that Iu2019ll have a solution:
I created a UDF on the Item Master Inventory tab rows, which I called OITW.U_Test
I need to populate this UDF with the following calculation: (OITW.OnHand * OITW.AvgPrice) + (T1.OnOrder * (Sum of all the quantities on open POu2019s)) / (OITW.OnHand + T1.OnOrder)
Here is the logic behind it: This UDF must show a modified Moving Average. Because POu2019s does not update the AvgPrice (only the Goods Receipt PO) this is cause for concern for this client who might have Sales Orders for Items that is not in stock yet, and posted as a lower AvgPrice.
Here is what I have done so far:
Select T0.ItemCode, T1.OnHand, T1.AvgPrice, T1.OnOrder,
T1.OnHand*T1.AvgPrice as 'InStock Value',
T1.OnOrder* ?????? as 'PO Value'
From OITM T0 INNER JOIN OITW T1 ON T0.ItemCode = T1.ItemCode
INNER JOIN POR1 T2 ON T0.ItemCode = T2.ItemCode
Any help will be appreciated.
MarliGordon,
I tested this and you are right, to use a FS will not work because of the refresh issue.
I'm now working on a Stored Procedure that will update this UDF when a PO is Added or Updated. My experience with Stored Procedures is limited to True or False statements. (If this is true, do not add the Document, if it is false add the document)
My question is: Can I populate the UDF, with a Value according to my query, with a Stored Procedure?
Thanks for your help.
Marli -
Formatted searches and SQL functions
Hi,
I have made test to call a SQL function in a formatted search. It seems to be impossible?
Is it right or not ?
Thanks for your help.You don't need to put a semicolumn, and don't have to put quote's around sbo variables (from a form)...
<b>Example</b>[code]SELECT ItemCode, ItemName FROM OITM WHERE WhsCode = $[$38.1.0] AND SellItem = 'Y' AND OnHand > 0[/code]
Hope it helps... -
Hi all,
I have an issue with a formatted search.
My intention is to update the field RDR1.vatgroup with a value set in a UDF on the sales order.
I have not been able to make it work, and If someone have a quick help idea it would be nice.
I have defined a userdefined field called u_avgcode. This is linked to some valied values for field like U1,U2,U3. The structure is 1=U1 and 2=U2 and so on.
<u>When I change a value here I would like to update the whole salesorder (all lines) with this value replacing the Tax code (RDR1.Vatgroup).</u>
The formatted search is like this on the RDR1.vatgroup:
if (Select $[$ORDR.U_avgcode]) = 'U1'
begin
declare @newcode as nvarchar(25)
set @newcode = U1
select @newcode
end
I have set 'Auto refresh' when the UDF field changes.
I can't make this work properly, any ideas..
I have also tried if (Select $[ORDR.U_avgcode]) = 'U1' with no luck.
regards
meThanx for input Juha.
I have made a solve to the problem, and it works fine now.
My FS is like:
declare @newtaxcode as nvarchar(2)
if (Select $[ORDR.U_avgkode]) = 'U0'
begin
set @newtaxcode = 'U0'
select @newtaxcode
end
I set this FS on my taxcode, and refered to my UDF when it changed. Works fine, but the screen is a bit flashy and "slow" when updating 50 order lines in a sales order.
I am now able to update many lines in a matrix with a single select from a UDF.
<u>Thanx to Ibai too, for helping me on track.</u>
One issue that also was a key element is to refer to the defined values for the UDF.
I had set like this:
code description
1 U0
2 U1
3 U2
I changed this too
code description
U0 U0
U1 U1
U2 U2
regards
me -
Formatted Search and "copy To" Function
I have created a Formatted Search on the document field series (delivery) that picks up the country from BP and sets the right series. This all works fine but something else is also happening:
When I use the "copy To" Function in the base document (order) the formatted Search in the target document (delivery) will not be executed and therefore the series will not be set correctly. Is this a bug? Exists a workarraound?
I use the version 2007 PL08.
Thanks for your help
GertI still think it's a bug/flaw. We got the run around from support with suggestions to trigger on some other field like the suggestions above. I'm working on a client on 2005a SP01 PL42 and I've seen the issue even earlier than this patch. We ended up handling this as part of a small add-on because this functionality had to work reliably and we could not depend on the users to always use the Copy From. Plus, you can save a lot of time by having an alert with let's say orders that are ready to be delivered or invoiced, and all the user has to do is drill into the alert to open the order and copy to invoice, rather than figuring out the customer code on the invoice to use the copy from button.
You could open a ticket... maybe you'll have better luck. I still think this functionality should be consistent on either direction of the flow.
Liviu -
Event Viewer: How to search and find event with specific text in the EventData
Hello,
When I use "Find..." option in the windows event log, it does not search within event's detail or text in <EventData> xml node on the event.
Is there any easy, out of the box way to find all events that include an specific phrase in the <EventData> ?
Thank you,Hi Allan,
I‘m writing to check if the suggestions were helpful, if you have
any questions, please feel free to let me know.
If you have any feedback on our support,
please click here.
Best Regards,
Anna
TechNet Community Support -
Problem in implementing formatted search
Dear All,
I am using the below code to implement formatted search for item master itemcode textbox. But i am unable to get the formatted search icon for the itemcode text box/ screen. Please correct me where I am going wrong.
Dim oRs As SAPbobsCOM.Recordset
oRs = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
Dim oQuery As SAPbobsCOM.UserQueries = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserQueries)
oQuery.Query = "SELECT T0.[ItemCode], T0.[ItemName] FROM OITM T0" 'Query
oQuery.QueryCategory = -1
oQuery.QueryDescription = "GetDfltBin"
oQuery.Add()
Dim oFormatted As SAPbobsCOM.FormattedSearches = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oFormattedSearches)
oFormatted.FormID = "150"
oFormatted.ItemID = "5"
oFormatted.Action = SAPbobsCOM.BoFormattedSearchActionEnum.bofsaQuery
oFormatted.FieldID = "ItemCode"
oFormatted.ColumnID = "-1"
oRs.DoQuery("select IntrnalKey from OUQR(nolock) Where QName = 'GetDfltBin'")
oFormatted.QueryID = oRs.Fields.Item("IntrnalKey").Value ''""
oFormatted.Refresh = SAPbobsCOM.BoYesNoEnum.tYES
oFormatted.ForceRefresh = SAPbobsCOM.BoYesNoEnum.tYES
oFormatted.ByField = SAPbobsCOM.BoYesNoEnum.tYES
Regards,
Noor hussain
Edited by: noor_023 on Mar 30, 2010 12:51 PMDear J,
Thanx for your post. I am gettig this error now. "The entry already exists in the following tales odbc-2035". I am writing the above code in the page load event of item master form as below.
If ((pVal.FormType = 150 And pVal.EventType <> SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD) And (pVal.Before_Action = True)) Then
'// get the event sending form
oForm = oSboApplication.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)
If ((pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_LOAD) And (pVal.Before_Action = True)) Then
Dim oRs As SAPbobsCOM.Recordset
oRs = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
Dim oQuery As SAPbobsCOM.UserQueries = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserQueries)
oQuery.Query = "SELECT T0.[ItemCode], T0.[ItemName] FROM OITM T0" 'Query
oQuery.QueryCategory = -1
oQuery.QueryDescription = "GetDfltBin1"
oQuery.Add()
Dim oFormatted As SAPbobsCOM.FormattedSearches = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oFormattedSearches)
oFormatted.FormID = "150"
oFormatted.ItemID = "5"
oFormatted.Action = SAPbobsCOM.BoFormattedSearchActionEnum.bofsaQuery 'bofsaQuery 'bofsaQuery
oFormatted.FieldID = "5" 'ItemCode
oFormatted.ColumnID = "-1"
oRs.DoQuery("select IntrnalKey from OUQR(nolock) Where QName = 'GetDfltBin1'")
oFormatted.QueryID = oRs.Fields.Item("IntrnalKey").Value ''"" ' oRs.GetField
oFormatted.Refresh = SAPbobsCOM.BoYesNoEnum.tYES
oFormatted.ForceRefresh = SAPbobsCOM.BoYesNoEnum.tYES
oFormatted.ByField = SAPbobsCOM.BoYesNoEnum.tYES
oFormatted.Add()
If oFormatted.Add() Then ' 0 Then
MsgBox(oCompany.GetLastErrorDescription)
End If
End If
End If -
Formatted Search with DI leads to a very slow performance - HELP....
Hello There
I have defined some formatted search in OPCH - everything is working fine.
I have added some logic to this form via the DI.(handlling 1 item press_event), and I get a very very slow performance - the ADDON-EXE jumps TO 230MEGA of memory, and entering values to each row in the tables/item in the form takes about 15 seconds.
Any suggestions?
RGDS
HAGAIHi Hagai,
Normally an addon written using the DI would take up 60-80MBs.
Are you filtering out all events except for the item press event for the form? If you are not filtering events then this can have quite a drastic affect on performance.
What logic have you got behind the press event? If the addon exe is ballooning out to 230MB then it suggests that there is either a problem with a memory leak or that an error is occuring in the code. I would recommend putting try/catch clauses at suitable places in the code and maybe specifically setting objects to null and calling the .NET garbage collector to try and minimise the potential for memory leaks.
Are you sure that it is the combination of the formatted search and the addon that is causing the problem, i.e. if you take away the formatted search but leave the addon do you still get poor performance or does everything speed up?
Hope this helps,
Owen -
Hi,
I'm trying to learn how to use formatted searches and SQL in SAP Business One. Can anyone give me some simple examples to start with?
For example, on AR Invoice, if customer (OINV cardcode) is X, a UDF field should be populated 'Y". If customer (OINV cardcode) is not X, UDF field should be populated 'N'.
Can you provide me the SQL code for the query to be used in the formatted search? Just looking for some examples to get started.
thanksThanks Gordon, that worked!
How do you know that $[$4.0.0] is OINV,cardcode(BP name on AR invoice)?
For example, if I want to use a different field intead (like Item No.) how do I know the paramater/variable to sue?
I guess $[ ] means a user input paramater(not yet saved to database)? -
Formatted Search in Incoming Payments
Hi All, I require some assistance with a formatted search and query please.
I have create a UDF at a header level in an invoice - the value will be either D or blank.
I have then created a UDF at a line item level in the incoming payment window.
I would like to create a formatted search that looks at the invoices at the line item level in the payment window, and returns the value from the invoice (D or blank). Any assistance on what the query should be would be greatly appreciated.
Also, as the invoice numbers are variable fields, what field should be used for the 'auto refresh' option?Hi Lisa,
It is very difficult to have create FMS that can be linked to header from row since it has different table. Row table and Header table are different. Why could you try to use the info from invoice table directly that can return value from it (D or blank) as you want ? what is the point in the invoice that can return the value ? is it invoice number ?
Rgds, -
BP Catalog numbers and Item Codes Display
Hello
Is there any way that BP catalog numbers and item codes can be display together.
Or is there any work around available.
I have a client who wishes to use i.e view both the item code and the BP Cat Number on their screen..,
we create a formatted search and this worked.
However the purchase orders which are automattically generated through another Add-on cant use a formatted search to work.
Thanks for your help in advance.
DDear Darpal,
Kindly check note 1059015 which describes the workaround to display both Item Number and the Business Partner.
Regards,
Varun
SAP Business One Forum Team -
Formatted Search - Using field index to refer to UDF in many documents
I have some UDFs in my marketing documents - say U_VALUE
I want to write a fairly complicated formatted search and use it for the same thing across all my marketing documents.
I don't want to use
$[ORDR.U_VALUE]
in my formatted search as this will only work in the sales order document.
I want to use something like
$[$4.0.0]
which brings back the cardcode independant of the form we are looking at. However
$[$U_VALUE.0.0]
will not work!
Hoping someone can help!
Edited by: Daniel Abbatt on Apr 10, 2008 6:16 PMYes you would have to have a UDF called VALUE on the marketing document for this example to run and even then it will error!
That's the point, the code above will not work, SBO only seems to be able to know about ORDR in a sales order and OINV in an invoice. So if I am in a sales order, it errors on the reference to OINV, even though the code that uses the
$[OINV.U_VALUE]
is never actually accessed by the SQL. I guess this is because SBO does the substitutions before it executes the code.
All I am basically trying to do is create a generic formatted search that will perform an action using the value of a UDF, say some formatting, the problem is I want it to work with any marketing document.
The only way I can find to access a UDF though is by having to use the
$[TABLE.U_FIELDNAME]
way, which seems to mean by definition I can only create a formatted search to access a header UDF for a single type of document. I cannot create a generic formatted search, that reverses the string for example, and use that formatted search across all marketing documents.
I know you can access normal fields also by their item reference, i.e.
$[$4.0.0]
, but this syntax does not seem to work with UDF, even though the system information shows the item reference as U_VALUE, I cannot use the
$[$U_VALUE.0.0]
which would be ideal...
Edited by: Daniel Abbatt on Apr 14, 2008 12:05 PM
Maybe you are looking for
-
Should I add more memory when I update my iMac from 10.4.11 to Snow Leopard?
Should I add more memory when I updaate my iMac from 10.4.11 to Snow Leopard?
-
17" Intel iMac Kernel Panic, Freezing at Grey Screen and Beeping!
Hi there, I have a new 17" Intel iMac (Intel Core 2 Duo 2 GHz, 250 GB, 1GB Memory with OS X 10.4.8) that keeps getting those "You need to restart your computer. Hold down the Power button for several seconds or press the Restart button." messages. It
-
Customer Party Account Not displayed
Dear All, After Saving the billing document, If I see the accounting document, The customer party account is not displayed. Instead I see a G/L account in place of my customer account. Calculations are correct but cant see the customer account. Need
-
Solaris 10 only wants to work on low resolution
Hi, I have a NVIDIA Vanta 16mb video card with an AOC Spectrum 7Eira 17" monitor. When installing Solaris 10 it detected correctly the video and monitor and I selected 1024x768 256 colors resolution. Now the OS only works on a 640x480 resolution. I t
-
ORA-01652: unable to extend temp segment by 128 in tablespace TEMP
Hi, I am getting the following error while executing an insert query. ORA-01652: unable to extend temp segment by 128 in tablespace TEMP. I have tried increasing the TEMP tbsp size it got resolved temporarily but occurred again after few days. When t